/*
 * my_camera.c
 *
 *  Created on: Feb 19, 2024
 *      Author: 86138
 */
#include "zf_common_headfile.h"
#define HEIGHT 120
#define WIDTH 188
#define RESULT_WIDTH 128
#define RESULT_HEIGHT 110
//历史遗留产物
uint8_t mode = 0;
uint8_t flag1 = 0;
uint8_t flag2 = 0;
uint8_t flag_shizi = 0;
uint8_t dec_right = 0, inc_right = 0;
uint8_t test1 = 0, right_circle_flag = 0;

void camera_handler(void) {
    gpio_set_level(D5, 1);
    adapt_threshold();
    gpio_set_level(D5, 0);
    //显示屏显示图像 可以留着debug
//           for (int i = 0; i < RESULT_WIDTH ;i++) {
//               for (int j = 0; j < RESULT_HEIGHT ;j++) {
//                  //*PerImg_ip[j][i]=0;
//                  image_threshold[j][i] = 0;
//                  image_threshold[j][i] = *PerImg_ip[j][i];
//             }
//            }

//           (*image_threshold)[RESULT_WIDTH]=*PerImg_ip;
    if (flag == 1) {
        if (road > 3) {
            garage();
        }
    }
    detect_seed(height - 1); //height 109
    gpio_set_level(D5, 1);

    delta();
    gpio_set_level(D5, 0);
}

